package com.hyt.model.cloudefile.enums;

import lombok.Getter;
import org.apache.commons.lang3.StringUtils;

/**
 * 文件状态枚举
 * @author huangwu
 */
@Getter
public enum StatusEnum {


    DOWNING("1", "下载中"),
	DOWNSUCCESS("2", "下载完成"),
	DOWNFAIL("3", "下载失败"),
	IMPORTING("11", "导入中"),
	IMPORTSUCCESS("12", "导入完成"),
	IMPORTFAIL("13", "导入失败"),
    ;
    /**
     * 文件处理状态
     */
    private final String status;
    /**
     * 描述信息
     */
    private final String statusDesc;


	private StatusEnum(String status, String statusDesc) {
		this.status = status;
		this.statusDesc = statusDesc;
	}
	
	
	public static StatusEnum getFileStatusEnumByStatus(String status) {
		if(StringUtils.isEmpty(status)) {
			return null;
		}
		for (StatusEnum fileStatusEnum : StatusEnum.values()) {
			if(fileStatusEnum.getStatus().equals(status)) {
				return fileStatusEnum;
			}
		}
		return null;
	}
    
    
    
	
    
}
